#define _CRT_SECURE_NO_WARNINGS 1

int removeDuplicates(int* nums, int numsSize)
{
	int count = 0;

	for (int i = count + 1; i < numsSize; i++)
	{
		if (nums[i] != nums[count])
		{
			count++;
			nums[count] = nums[i];
		}

	}

	return count + 1;
}

int removeElement(int* nums, int numsSize, int val) {

	while (1)
	{
		int pos = 0;

		for (pos = 0; pos < numsSize; pos++)
		{
			if (nums[pos] == val)
				break;
		}

		if (pos == numsSize)
			break;

		for (int i = pos + 1; i < numsSize; i++)
		{
			nums[i - 1] = nums[i];
		}
		numsSize--;
	}

	return numsSize;
}